package com.cares.event.listener.servicestart;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

public class JsflowListener implements ServletContextListener {
	
	private java.util.Timer timer = null ;  
	
	@Override
	public void contextDestroyed(ServletContextEvent arg0) {

	}

	@Override
	public void contextInitialized(ServletContextEvent event) {
		 timer = new java.util.Timer(true) ;  
	     event.getServletContext().log("定时器已启动。") ;
	     //服务启动延时20秒执行
	     timer.schedule(new JsflowTask(event.getServletContext()), 20000) ;  
	     event.getServletContext().log("已经添加任务调度表。" ) ;  
	        
	}
}
